#include<iostream>
using namespace std;

struct edge
{
	int to, nxt;
}e[5005];

int head[5005] = {0};
int gifts[5005] = {0};
int path[5005][2] = {0};
int ind = 0;

void add(int a, int b)
{
	e[++ind] = {a, head[b]};
	head[b] = ind;	
}

int max_gifts = 0;

void dfs(int fa, int end, int cur, int cur_gifts)
{
	if(cur == 0) return;
	if(cur == end)
	{
		max_gifts = max(cur_gifts, max_gifts);
	}
	for(int i = head[cur]; i; i = e[i].nxt)
	{
		if(e[i].to == fa) continue;
		dfs(cur, end, e[i].to, cur_gifts + gifts[i]);
	}
	return;
}

void solve(int q)
{
	for(int i = 0; i < q; i++)
	{
		dfs(0, path[i][1], path[i][0], gifts[path[i][0]]);
		cout << max_gifts << endl;
		max_gifts = 0;	
	}
}

int main()
{
	int n, q;
	cin >> n >> q;
	for(int i = 0, u, v; i < n - 1; i++)
	{
		cin >> u >> v;
		add(u, v);
		add(v, u);
	}
	for(int i = 1; i <= n; i++)
	{
		cin >> gifts[i];
	}
	for(int i = 0; i < q; i++)
	{
		cin >> path[i][0] >> path[i][1];
	}
	solve(q);
	
	return 0;
}
